# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Marco Scarpetta <marcoscarpetta02@gmail.com>

pkgname=pdfmixtool
pkgver=1.1.1
pkgrel=1
pkgdesc='Application to split, merge, rotate and mix PDF files'
arch=('loong64' 'x86_64')
url='https://scarpetta.eu/pdfmixtool/'
license=('GPL3')
depends=('hicolor-icon-theme' 'qpdf' 'imagemagick' 'qt6-svg')
makedepends=('cmake' 'ninja' 'qt6-tools')
source=("https://gitlab.com/scarpetta/pdfmixtool/-/archive/v$pkgver/$pkgname-v$pkgver.tar.gz")
sha256sums=('13fe771e8bb724d77a888443b3c6196cb9f81a6de5ef41351a111123e848e267')

prepare() {
  # Update URL
  sed -i 's/scarpetta.gitlab.io/scarpetta.eu/' $pkgname-v$pkgver/resources/eu.scarpetta.PDFMixTool.appdata.xml
}

build() {
  cmake -S $pkgname-v$pkgver -B build -G Ninja -DCMAKE_INSTALL_PREFIX='/usr' -DQT_VERSION=6
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
